using Avalonia.Controls;
using GitNet.WindowsApp.ViewModels;

namespace GitNet.WindowsApp.Views;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
    
    public async void OpenFolder()
    {
        var dialog = new OpenFolderDialog();
        var result = await dialog.ShowAsync(this);
        if (string.IsNullOrEmpty(result)) return;
        if (DataContext is MainWindowViewModel model)
            model.ToFolderView(result);
    }
}